package cn.bytengine.stem.events;

import cn.bytengine.stem.functional.Consumers;

import java.io.Serializable;

public interface EventBus {
    void post(String eventName, Object... args);

    void pub(String eventName, Object... args);

    void unregister(String eventName, Serializable serializable);

    EventBus register(String eventName, Consumers.Consumer0 consumer0, RegisterOption... options);

    <T1> EventBus register(String eventName, Consumers.Consumer1<T1> consumer, RegisterOption... options);

    <T1, T2> EventBus register(String eventName, Consumers.Consumer2<T1, T2> consumer, RegisterOption... options);

    <T1, T2, T3> EventBus register(String eventName, Consumers.Consumer3<T1, T2, T3> consumer, RegisterOption... options);

    <T1, T2, T3, T4> EventBus register(String eventName, Consumers.Consumer4<T1, T2, T3, T4> consumer, RegisterOption... options);

    <T1, T2, T3, T4, T5> EventBus register(String eventName, Consumers.Consumer5<T1, T2, T3, T4, T5> consumer, RegisterOption... options);

    <T1, T2, T3, T4, T5, T6> EventBus register(String eventName, Consumers.Consumer6<T1, T2, T3, T4, T5, T6> consumer, RegisterOption... options);

    <T1, T2, T3, T4, T5, T6, T7> EventBus register(String eventName, Consumers.Consumer7<T1, T2, T3, T4, T5, T6, T7> consumer, RegisterOption... options);

    <T1, T2, T3, T4, T5, T6, T7, T8> EventBus register(String eventName, Consumers.Consumer8<T1, T2, T3, T4, T5, T6, T7, T8> consumer, RegisterOption... options);

    <T1, T2, T3, T4, T5, T6, T7, T8, T9> EventBus register(String eventName, Consumers.Consumer9<T1, T2, T3, T4, T5, T6, T7, T8, T9> consumer, RegisterOption... options);

    <T1, T2, T3, T4, T5, T6, T7, T8, T9, TA> EventBus register(String eventName, Consumers.ConsumerA<T1, T2, T3, T4, T5, T6, T7, T8, T9, TA> consumer, RegisterOption... options);

    <T1, T2, T3, T4, T5, T6, T7, T8, T9, TA, TB> EventBus register(String eventName, Consumers.ConsumerB<T1, T2, T3, T4, T5, T6, T7, T8, T9, TA, TB> consumer, RegisterOption... options);

    <T1, T2, T3, T4, T5, T6, T7, T8, T9, TA, TB, TC> EventBus register(String eventName, Consumers.ConsumerC<T1, T2, T3, T4, T5, T6, T7, T8, T9, TA, TB, TC> consumer, RegisterOption... options);
}
